<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .active{
            background: red;
        }
        .box{
            width:200px;
            height: 200px;
            border:1px solid #ccc;
            font-size: 30px;
            text-align:center;
            line-height: 200px;
        }
    </style>
</head>
<body>
    <div id="app">
        <input type="button" :class="{active:num==0}" value="1" @click="change(0)">
        <input type="button" :class="{active:num==1}" value="2" @click="change(1)">
        <input type="button" :class="{active:num==2}" value="3" @click="change(2)">
        <div class="box" v-show="num==0">
            1
        </div>
        <div class="box" v-show="num==1">
            2
        </div>
        <div class="box" v-show="num==2">
            3
        </div>
    </div>
    <script src="./vue.js"></script>
    <script>
        let vm = new Vue({
            el:"#app",
            data:{
                num:0
            },
            methods:{
                change(n){
                    this.num = n;
                }
            }
        })
    </script>
</body>
</html>